home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-4.0 / gdb / copying.awk < prev    next >
Encoding:
AWK Script  |  1991-08-24  |  1.4 KB  |  57 lines

  1. BEGIN    {
  2.       FS="\"";
  3.       print "/* Do not modify this file; it is created automatically";
  4.       print "   by copying.awk.  */";
  5.       print "#include <stdio.h>"
  6.       print "#include \"defs.h\""
  7.       print "#include \"command.h\""
  8.       print "extern int immediate_quit;";
  9.       print "static void";
  10.       print "copying_info ()";
  11.       print "{";
  12.       print "  immediate_quit++;";
  13.     }
  14. NR == 1,/^[     ]*NO WARRANTY[     ]*$/    {
  15.       if (! ($0 ~ /^[     ]*NO WARRANTY[     ]*$/)) 
  16.         {
  17.           printf "  printf_filtered (\"";
  18.           for (i = 1; i < NF; i++)
  19.         printf "%s\\\"", $i;
  20.           printf "%s\\n\");\n", $NF;
  21.         }
  22.     }
  23. /^[     ]*NO WARRANTY[     ]*$/    {
  24.       print "  immediate_quit--;";
  25.       print "}";
  26.       print "";
  27.       print "static void";
  28.       print "warranty_info ()";
  29.       print "{";
  30.       print "  immediate_quit++;";
  31.     }
  32. /^[     ]*NO WARRANTY[     ]*$/, /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/{  
  33.       if (! ($0 ~ /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/)) 
  34.         {
  35.           printf "  printf_filtered (\"";
  36.           for (i = 1; i < NF; i++)
  37.         printf "%s\\\"", $i;
  38.           printf "%s\\n\");\n", $NF;
  39.         }
  40.     }
  41. END    {
  42.       print "  immediate_quit--;";
  43.       print "}";
  44.       print "";
  45.       print "void"
  46.       print "_initialize_copying ()";
  47.       print "{";
  48.       print "  add_info (\"copying\", copying_info,";
  49.       print "        \"Conditions for redistributing copies of GDB.\");";
  50.       print "  add_info (\"warranty\", warranty_info,";
  51.       print "      \"Various kinds of warranty you do not have.\");";
  52.       print "}";
  53.     }
  54.  
  55.  
  56.         
  57.